import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/IndexPage'

const IndexPage = () => import('../page/index')
const OtherPage = () => import('../page/other')
const AboutPage = () => import('../page/about')
const DetailPage = () => import('../page/detail')

const ForecastPage = () => import('../page/detail/forecast')
const AnalysisPage = () => import('../page/detail/analysis')
const CountPage = () => import('../page/detail/count')
const PublishPage = () => import('../page/detail/publish')
const OrderlistPage = () => import('../page/orderList')

Vue.use(Router)

export default new Router({
  mode: 'history',
  linkActiveClass: 'active',
  linkExactActiveClass: 'active',
  routes: [
    {
      path: '/',
      component: IndexPage
    }, {
      path: '/other',
      component: OtherPage,
      name: 'other'
    },
    {
      path: '/about',
      component: AboutPage,
      name: 'about'
    },
    {
      path: '/detail',
      component: DetailPage,
      redirect:'/detail/analysis',
      name: 'detail',
      children: [
        { path: 'forecast', component:ForecastPage},
        { path: 'analysis', component:AnalysisPage},
        { path: 'count', component:CountPage},
        { path: 'publish', component:PublishPage},
      ]
    },
    {
      path: '/orderList',
      component: OrderlistPage,
      name: 'orderList',
    }
  ]
})
